package com.ymttest.common.enums;

/**
 * 优惠券的性质类型
 */
public enum CouponUsageTypeEnum {
	/**
	 * 普通优惠券
	 */
	Common(1),

	/**
	 * 推广码
	 */
	Promotion(2);

	private int intValue;
	private static java.util.HashMap<Integer, CouponUsageTypeEnum> mappings;

	private synchronized static java.util.HashMap<Integer, CouponUsageTypeEnum> getMappings() {
		if (mappings == null) {
			mappings = new java.util.HashMap<Integer, CouponUsageTypeEnum>();
		}
		return mappings;
	}

	private CouponUsageTypeEnum(int value) {
		intValue = value;
		CouponUsageTypeEnum.getMappings().put(value, this);
	}

	public int getValue() {
		return intValue;
	}

	public static CouponUsageTypeEnum forValue(int value) {
		return getMappings().get(value);
	}
}